import axios from 'axios';

const API_BASE_URL = process.env.REACT_APP_API_BASE_URL;

const axiosInstance = axios.create({
    baseURL: API_BASE_URL,
});

axiosInstance.interceptors.request.use(config => {
    // do something before request is sent
    console.log("请求拦截器")
    console.log(config)
    return config;
}, error => {
    // handle request error
    return Promise.reject(error);
});

axiosInstance.interceptors.response.use(response => {
    // do something with response data
    console.log("响应拦截器")

    return response;
}, error => {
    // handle response error
    return Promise.reject(error);
});
export default axiosInstance;